package example.POI;

import java.util.LinkedList;
import java.util.List;

public class POIImages {
    private static  POIImages instance = null;
    List<POIImageItem> images = null;

    private POIImages()
    {
        images = new LinkedList<POIImageItem>();
    }
    public static POIImages getInstance()
    {
        if(instance == null)
        {
            instance = new POIImages();
        }
        return instance;
    }

    public void addImage(POIImageItem item)
    {
        images.add(item);
    }
    public List<POIImageItem> getImages()
    {
        return images;
    }
    public void clear()
    {
        images.clear();
    }
    public POIImageItem getImages(int row, int col)
    {

        for(POIImageItem item : images)
        {
            if(item.row == row && item.col == col)
            {
                return item;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return "POIImages{" +
                "images=" + images +
                '}';
    }
}
